#ifndef MATLITE_H
#define MATLITE_H

class matlite
{
public:
  matlite();
  matlite(int nrow, int ncol);
  matlite(matlite &src);
  ~matlite();

  void copyRegion(matlite &a, int frmIdx[], int toIdx[]);
  void resize(int nrow, int ncol, bool isKeepData=false);
  void zeros(int nrow, int ncol);
  void eye(int nrow, int ncol);
  void choleskyInv();
  friend void matAdd(matlite &ans, matlite &a, matlite &b);
  friend void matMinus(matlite &ans, matlite &a, matlite &b);
  friend void matMult(matlite &ans, matlite &a, matlite &b, bool isTransposeB=false);
  friend void matMultAdd(matlite &ans, matlite &a, matlite &b, matlite &c, bool isTransposeB=false);
  int nRow() {return m_nrow;}
  int nCol() {return m_ncol;}
  void show();
  friend void transpose(matlite &ans,matlite &trans);

  bool checkPositiveDef();

  double **val;
private:
  int m_nrow, m_ncol, m_rsrow, m_rscol, m_rowinc, m_colinc;

};



#endif
